<template>
	<scroll-view class="backview" bounces="false">
		<lexiconNavVue title="答题详情" />
		<view class="top-menu">
		</view>
		<scroll-view class="words-scroll">
			<view class="content-back">
				<view class="sigin-calendar-backView">
					<view class="gameType-topTitle-view">
						<view class="gameType-topTitle" style="color: white;">
							答题列表 | Answer List
						</view>
						<view class="gameType-line"></view>
					</view>
					<view class="matters">注: *红色代表此次拼写错误单词，黑色代表拼写正确单词</view>
					<scroll-view :style="{ height: scrollHeight + 'px'}" scroll-y :scroll-with-animation='true'>
						<block v-for="(word, index) in wordList" :key="index">
							<view class='zimuback' :data-index="index">
								<view :class="`${word.isCorrect == 0 ? 'right' : 'error'} weizhi`">
									{{word.spell}}
								</view>
							</view>
						</block>
					</scroll-view>
				</view>
			</view>
		</scroll-view>
	</scroll-view>
</template>

<script>
	export default {
		data() {
			return {
				wordList: [],
				scrollHeight: 0,
			}
		},
		onReady() {
			const that = this;
			uni.createSelectorQuery().select('.matters').boundingClientRect(rect => {
				that.scrollHeight = uni.getSystemInfoSync().windowHeight - rect.bottom - 30;
			}).exec();
		},
		onLoad(options) {
			console.log('options', options);
			var resultData = JSON.parse(options.answerStr);
			console.log('resultData', resultData);
			this.wordList = resultData;
		},
		methods: {

		}
	}
</script>

<style>
	.sigin-calendar-backView {
		width: 350px;
		margin: 15px 0px;
		box-sizing: border-box;
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		background: var(--beeGradientTopBack);
		/* background-image: url(https://cdn.spbcn.org/spbcnappneed/daka_riliback.png);
			background-repeat: no-repeat;
			background-size: 100% 100%; */
		padding: 20px 5px;
		border-radius: 25px;
	}

	.matters {
		width: 300px;
		height: 30px;
		margin-top: 10px;
		background: var(--themeColor);
		color: red;
		font-size: 10px;
		text-align: center;
		border-radius: 15px;
		line-height: 30px;
	}

	.zimuback {
		width: 90%;
		margin-left: 5%;
		margin-top: 15px;
		height: 40px;
		border-radius: 20px;
		display: flex;
		flex-direction: row;
		align-items: center;
		background: #ede6cd;
	}

	/* 字母位置 */
	.weizhi {
		margin: 0 25px 0 25px;
		font-size: 14px;
		color: rgb(0, 0, 0);
	}

	.right {
		color: black;
	}

	.error {
		color: var(--themeColorTwo);
	}
</style>